<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>echarts</title>
    <style>
      .container1,
      .container2 {
        width: 800px;
        height: 400px;
      }
    </style>
  </head>
  <body>
    <div class="container1"></div>
    <div class="container2"></div>
    <!-- 引入文件 -->
    <script src="./echarts.js"></script>
    <script>
      const myEcharts1 = echarts.init(document.querySelector(".container1"));
      const myEcharts2 = echarts.init(document.querySelector(".container2"));
      const option1 = {
        xAxis: {
          data: ["美女", "帅哥", "大哥", "大姐"],
        },
        yAxis: {},
        series: {
          type: "bar",
          data: [100, 150, 90, 200],
        },
      };
      const option2 = {
        xAxis: {
          data: ["美女", "帅哥", "大哥", "大姐"],
        },
        yAxis: {},
        series: {
          type: "line",
          data: [100, 150, 90, 200, 233],
        },
        color: ["yellowgreen"],
      };
      myEcharts1.setOption(option1);
      myEcharts2.setOption(option2);
    </script>
  </body>
</html>
